﻿Imports System.Windows.Forms

Public Class Paths
    Private M_Plugins As String
    Private M_Macro As String
    Private M_Project As String
    Private M_Data As String
    Private M_Settings As String

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub
    Public Property SettingsPath() As String
        Get
            Return M_Settings
        End Get
        Set(ByVal value As String)
            M_Settings = value
            Label9.Text = value
        End Set
    End Property
    Public Property DataPath() As String
        Get
            Return M_Data
        End Get
        Set(ByVal value As String)
            M_Data = value
            Label7.Text = value
        End Set
    End Property
    Public Property PluginsPath() As String
        Get
            Return M_Plugins
        End Get
        Set(ByVal value As String)
            M_Plugins = value
            Label4.Text = value
        End Set
    End Property
    Public Property MacroPath() As String
        Get
            Return M_Macro
        End Get
        Set(ByVal value As String)
            M_Macro = value
            Label5.Text = value
        End Set
    End Property
    Public Property ProjectsPath() As String
        Get
            Return M_Project
        End Get
        Set(ByVal value As String)
            M_Project = value
            Label6.Text = value
        End Set
    End Property
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If IO.Directory.Exists(M_Plugins) Then
            FB1.SelectedPath = M_Plugins
        Else
            FB1.SelectedPath = Application.StartupPath
        End If
        If FB1.ShowDialog = Windows.Forms.DialogResult.OK Then
            M_Plugins = FB1.SelectedPath
            Label4.Text = M_Plugins
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If IO.Directory.Exists(M_Macro) Then
            FB1.SelectedPath = M_Macro
        Else
            FB1.SelectedPath = Application.StartupPath
        End If
        If FB1.ShowDialog = Windows.Forms.DialogResult.OK Then
            M_Macro = FB1.SelectedPath
            Label5.Text = M_Macro
        End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If IO.Directory.Exists(M_Project) Then
            FB1.SelectedPath = M_Project
        Else
            FB1.SelectedPath = Application.StartupPath
        End If
        If FB1.ShowDialog = Windows.Forms.DialogResult.OK Then
            M_Project = FB1.SelectedPath
            Label6.Text = M_Project
        End If
    End Sub

    Private Sub TableLayoutPanel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles TableLayoutPanel1.Paint

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If IO.Directory.Exists(M_Data) Then
            FB1.SelectedPath = M_Data
        Else
            FB1.SelectedPath = Application.StartupPath
        End If
        If FB1.ShowDialog = Windows.Forms.DialogResult.OK Then
            M_Data = FB1.SelectedPath
            Label7.Text = M_Data
        End If

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        If IO.Directory.Exists(M_Settings) Then
            FB1.SelectedPath = M_Settings
        Else
            FB1.SelectedPath = Application.StartupPath
        End If
        If FB1.ShowDialog = Windows.Forms.DialogResult.OK Then
            M_Data = FB1.SelectedPath
            Label9.Text = M_Settings
        End If
    End Sub
End Class
